import ajax from './ajax'
// 1、根据经纬度获取位置详情
// http://localhost:3000/position/:geohash
  export const reqAddress =(geohash)=>ajax('/api/position'+geohash)

// [2、获取食品分类列表](#2获取食品分类列表)<br/>
  export const reqCategorys =()=>ajax('/api/index_category')
//   3、根据经纬度获取商铺列表
//   http://localhost:3000/shops?latitude=40.10038&longitude=116.36867
  export const reqShops =({latitude,longitude})=>ajax('/api/shops',{latitude,longitude})
  // 6、用户名密码登陆
//   http://localhost:3000/login_pwd
  export const reqPwdLogin =({name,pwd,captcha})=> ajax('/api/login_pwd',{name,pwd,captcha},'POST')
  
//7.发送短信验证 http://localhost:3000/sendcode

export const  reqPhoneCode=(phone)=>ajax('/api/sendcode',{phone})
// 8手机号码登录成功
    // http://localhost:3000/login_sms
  export const reqPhoneLogin=({phone,code})=>ajax('/api/login_sms',{phone,code},'POST')

//   9 请求登出
// */
export const reqLogout = () => ajax('/api/logout')
